import React, { Component } from 'react'
import styles from './FormItem.less'
class FormItem extends Component {
  render() {
    const { label, children, flex = "row", ...rest } = this.props
    let className = flex === 'row' ? `${styles.container} ${styles.row}` : `${styles.container} ${styles.column}`
    return (
      <div className={className} {...rest}>
        <div className={styles.label}>{label}</div>
        <div className={styles.value}>{children}</div>
      </div>
    )
  }
}
export default FormItem
